package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.come.mouslisten.AddTeXiaoMouslisten;
import org.come.until.CutButtonImage;

import com.tool.btn.SpecificBtn;
import com.tool.tcpimg.UIUtils;



public class DailyLoginGoodsJpanel extends JPanel {

	private SpecificBtn btnBuy;// 购买按钮
	private JLabel labBorder,// 背景框
			labImg;// 特效图片展示
	private String name,// 特效名字
			value;// 价值多少仙玉

	public ImageIcon icon = CutButtonImage.getImage("inkImg/old/background/8.png", 51, 51);
	private AddTeXiaoMouslisten xiaoMouslisten;

	public DailyLoginGoodsJpanel() {
		this.setPreferredSize(new Dimension(250, 65));
		this.setLayout(null);
		this.setOpaque(false);
		this.setBackground(UIUtils.Color_BACK);

		xiaoMouslisten = new AddTeXiaoMouslisten();
		// 特效图片展示
		labImg = new JLabel();
		labImg.setBounds(21, 8, 49, 49);
		labImg.addMouseListener(xiaoMouslisten);
		this.add(labImg);

		// 购买按钮
		btnBuy = new SpecificBtn("skin/8100226/newbutton/B20.png", 1, "购买", 10);
		btnBuy.setBounds(180, 20, 59, 24);
		btnBuy.setForeground(Color.black);
		this.add(btnBuy);

		// 背景框
		labBorder = new JLabel();
		labBorder.setBounds(20, 7, 51, 51);
		labBorder.setIcon(icon);
		this.add(labBorder);

	}

	private ImageIcon iconLine = CutButtonImage.getImage("inkImg/old/background/57.png", 230, 1);

	@Override
	protected void paintComponent(Graphics g) {
		// TODO Auto-generated method stub
		super.paintComponent(g);
		g.setFont(UIUtils.TEXT_FONT2);
		g.setColor(Color.white);
		g.drawString("198800仙玉", 81, 20);
		g.setColor(Color.red);
		g.drawString("￥1988元", 81, 50);

			iconLine = CutButtonImage.getImage("inkImg/old/background/57.png", 230, 1);
		g.drawImage(iconLine.getImage(), 0, 0, 230, 1, this);

	}

	/*
	 * 清空界面的方法
	 */
	public void clearWindow() {
		name = "";
		value = "";
		labImg.setIcon(null);
		btnBuy.setBtn(0);
		btnBuy.setIcon(null);
		btnBuy.setText("");
		labBorder.setIcon(null);
		xiaoMouslisten.setEshop(null);
		btnBuy.setEshop(null);
	}

	public SpecificBtn getBtnBuy() {
		return btnBuy;
	}

	public void setBtnBuy(SpecificBtn btnBuy) {
		this.btnBuy = btnBuy;
	}

	public JLabel getLabImg() {
		return labImg;
	}

	public void setLabImg(JLabel labImg) {
		this.labImg = labImg;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public JLabel getLabBorder() {
		return labBorder;
	}

	public void setLabBorder(JLabel labBorder) {
		this.labBorder = labBorder;
	}

	public AddTeXiaoMouslisten getXiaoMouslisten() {
		return xiaoMouslisten;
	}

	public void setXiaoMouslisten(AddTeXiaoMouslisten xiaoMouslisten) {
		this.xiaoMouslisten = xiaoMouslisten;
	}
}
